package com.cskaoyan.day4;

import java.util.Arrays;

public class DivideByTheFirstElement {
    public static void main(String[] args) {
        double[] arr = {2.0, 4.0, 6.0, 4.0};
        System.out.println(Arrays.toString(arr));
        divideByTheFirstElement(arr);
        System.out.println(Arrays.toString(arr));

    }

    public static double[] divideByTheFirstElement(double[] arr) {
        for (int i = 1; i < arr.length; i++) {
            arr[i] /= arr[0];
        }
        return arr;
    }
}
